//
//  UIViewController+HUD.m
//  SISSAPP
//
//  Created by 优房网 on 2017/7/25.
//  Copyright © 2017年 优房网. All rights reserved.
//

#import "UIViewController+HUD.h"

@implementation UIViewController (YYRHUD)

+ (void)YYR_ShowHUDToWindow:(BOOL)animation {
    [MBProgressHUD YYR_ShowHUD:animation];
}

+ (void)YYR_HideHUDToWindow:(BOOL)animation {
    [MBProgressHUD YYR_HideHUD:animation];
}

- (void)YYR_ShowHUDToWindow:(BOOL)animation {
    [MBProgressHUD YYR_ShowHUD:animation];
}

- (void)YYR_HideHUDToWindow:(BOOL)animation {
    [MBProgressHUD YYR_HideHUD:animation];
}


/**
 显示提示消息
 
 @param msg 消息内容
 */
+ (void)YYR_ShowMsg:(NSString *)msg {
    [MBProgressHUD YYR_ShowMessage:msg];
}

+ (void)YYR_ShowErrToWindow:(NSString *)msg {
    [MBProgressHUD YYR_ShowError:msg toView:nil];
}

/**
 显示成功消息
 
 @param msg 消息内容
 */
+ (void)YYR_ShowSucc:(NSString *)msg {
    [MBProgressHUD YYR_ShowSuccess:msg];
}


/**
 显示错误消息
 
 @param msg 消息内容
 */
+ (void)YYR_ShowErr:(NSString *)msg {
    [MBProgressHUD YYR_ShowError:msg];
}



/**
 显示loading
 
 @param animation 是否显示动画
 */
- (void)YYR_ShowHUD:(BOOL)animation {
    [MBProgressHUD YYR_ShowHUD:self.view animation:animation];
}

/**
 隐藏loading
 
 @param animation 是否显示动画
 */
- (void)YYR_HideHUD:(BOOL)animation {
    [MBProgressHUD YYR_HideHUD:self.view animation:animation];
}

/**
 显示提示消息
 
 @param msg 消息内容
 */
- (void)YYR_ShowMsg:(NSString *)msg {
    [MBProgressHUD YYR_ShowMessage:msg];
}


/**
 显示成功消息
 
 @param msg 消息内容
 */
- (void)YYR_ShowSucc:(NSString *)msg {
    [MBProgressHUD YYR_ShowSuccess:msg];
}


/**
 显示失败消息
 
 @param msg 消息内容
 */
- (void)YYR_ShowErr:(NSString *)msg {
    [MBProgressHUD YYR_ShowError:msg];
}


@end
